Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor diff_drive demo #635

Open
wants to merge 4 commits into
base: ros2
Choose a base branch
from
Open

Refactor diff_drive demo #635

wants to merge 4 commits into from

Conversation

caguero
Copy link
Contributor

@caguero caguero commented Nov 6, 2024

Refactors the diff_drive demo leveraging the latest improvements in ros_gz.

  • I replaced the previous launch file from Python to XML.
  • QoS settings are also used.

Summary

Checklist

  • Signed all commits for DCO
  • Added tests
  • Updated documentation (as needed)
  • Updated migration guide (as needed)
  • Consider updating Python bindings (if the library has them)
  • codecheck passed (See contributing)
  • All tests passed (See test coverage)
  • While waiting for a review on your PR, please help review another open pull request to support the maintainers

Note to maintainers: Remember to use Squash-Merge and edit the commit message to match the pull request summary while retaining Signed-off-by messages.

@caguero caguero marked this pull request as ready for review November 22, 2024 20:41
Copy link
Collaborator

@ahcorde ahcorde left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we are not publishing the tf from Gazebo.

My suggestion here is to add the tf to the bridge

- ros_topic_name: "tf"
  gz_topic_name: "/model/vehicle_green/tf"
  ros_type_name: "tf2_msgs/msg/TFMessage"
  gz_type_name: "gz.msgs.Pose_V"
  direction: GZ_TO_ROS
- ros_topic_name: "tf"
  gz_topic_name: "/model/vehicle_blue/tf"
  ros_type_name: "tf2_msgs/msg/TFMessage"
  gz_type_name: "gz.msgs.Pose_V"
  direction: GZ_TO_ROS

and a static transform for each vehicle:

<node pkg="tf2_ros" exec="static_transform_publisher" args="--frame-id world  --child-frame-id vehicle_green/odom" />
<node pkg="tf2_ros" exec="static_transform_publisher" args="--frame-id world  --child-frame-id vehicle_blue/odom" />

And modify the RViz file to sue the "Fixed frame" as world and add the other odometry marker for the green vehicle


ros2 topic pub /model/vehicle_blue/cmd_vel geometry_msgs/msg/Twist "{linear: {x: 5.0}, angular: {z: 0.5}}"

This demo also shows the use of custom QoS parameters. The commands are
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why do you remove this comment?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The latest version of the code (79ece9e) preserves that block.

Signed-off-by: Carlos Agüero <[email protected]>
@caguero
Copy link
Contributor Author

caguero commented Nov 27, 2024

80d120b

we are not publishing the tf from Gazebo.

My suggestion here is to add the tf to the bridge

- ros_topic_name: "tf"
  gz_topic_name: "/model/vehicle_green/tf"
  ros_type_name: "tf2_msgs/msg/TFMessage"
  gz_type_name: "gz.msgs.Pose_V"
  direction: GZ_TO_ROS
- ros_topic_name: "tf"
  gz_topic_name: "/model/vehicle_blue/tf"
  ros_type_name: "tf2_msgs/msg/TFMessage"
  gz_type_name: "gz.msgs.Pose_V"
  direction: GZ_TO_ROS

and a static transform for each vehicle:

<node pkg="tf2_ros" exec="static_transform_publisher" args="--frame-id world  --child-frame-id vehicle_green/odom" />
<node pkg="tf2_ros" exec="static_transform_publisher" args="--frame-id world  --child-frame-id vehicle_blue/odom" />

And modify the RViz file to sue the "Fixed frame" as world and add the other odometry marker for the green vehicle

Thanks for the suggestion. Added in 80d120b. Could you give it a try please?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Status: In review
Development

Successfully merging this pull request may close these issues.

2 participants